/**
 * Interfaz que ofrece los métodos del servidor
 * @version 1; 27-4-2012; java version "1.6.0";
 * @author grup Programari.cat
 */
package common;

import beans.*;
import java.rmi.RemoteException;
import java.util.Date;
import java.util.List;
import java.util.Vector;


/**
 * Classe RemoteInterface
 *
 * @author Grup Programari.cat
 * @version 1.0; java version "1.6.0";
 */

public interface RemoteInterface extends java.rmi.Remote {


    //INICI SUBSISTEMA CONNEXIÓ I MANTENIMENT
    public Usuari sub1login(String username,String password) throws RemoteException, EOlympicsException;
    public Usuari sub1getUser(int idIntern)throws RemoteException,EOlympicsException;
    public Vector sub1getBusqueda(int idIntern, String nom, String cognom1, String cognom2) throws RemoteException,EOlympicsException;
    public Integer sub1addUser(int usuariAdministrador, char tipusUsuari, String idUsuari, String pwd, String email, char estatEnSistema, String tipusDocumentId, String document, String nom, String cognom1, String cognom2, String universitat)  throws RemoteException,EOlympicsException;
    public boolean sub1updateUser(int usuariAdministrador, int idIntern, char tipusUsuari, String idUsuari, String pwd, String email, char estatEnSistema, String tipusDocumentId, String document, String nom, String cognom1, String cognom2, String universitat, boolean isBaixa)  throws RemoteException,EOlympicsException;
    public boolean sub1deleteUser(int idIntern, char tipusUsuari) throws RemoteException,EOlympicsException;
    public Vector sub1getInscripcions(int idIntern) throws RemoteException,EOlympicsException;
    public Vector sub1getProves(int idIntern) throws RemoteException,EOlympicsException;
    public Vector sub1getRondes(int idIntern) throws RemoteException,EOlympicsException;
    public Vector sub1getParticipacions(int idIntern) throws RemoteException,EOlympicsException;
    //FI SUBSISTEMA CONNEXIÓ I MANTENIMENT



    //INICI SUBSISTEMA 2
    public List<Prova> sub2getLlistaProves(Prova prova) throws RemoteException,EOlympicsException;
    public Prova sub2alta(Prova prova) throws RemoteException,EOlympicsException;
    public Ronda sub2alta(Ronda ronda) throws RemoteException,EOlympicsException;
    public RespostaCorrecta sub2alta(RespostaCorrecta respostaCorrecta) throws RemoteException,EOlympicsException;
    public RespostaCorrecta sub2carregaRespostaCorrecta(RespostaCorrecta respostaCorrecta) throws RemoteException,EOlympicsException;
    public Prova sub2modifica(Prova prova) throws RemoteException,EOlympicsException;
    public Ronda sub2modifica(Ronda ronda) throws RemoteException,EOlympicsException;
    public void sub2modifica(RespostaCorrecta respostaCorrecta) throws RemoteException,EOlympicsException;
    public List <RespostaCorrecta> sub2getLlistaRespostes(Ronda ronda) throws RemoteException,EOlympicsException;
    public List<ControlInscripcionsDTO> sub2mostraControlInscripcions() throws RemoteException,EOlympicsException;
    public void sub2tancaInscripcions(int usuari,int minim) throws RemoteException,EOlympicsException;
    public List<RondaDTO> sub2cercarCompteticionsActives() throws RemoteException,EOlympicsException;
    public void sub2tancaCompeticio(Ronda ronda) throws RemoteException,EOlympicsException;
    public Integer sub2recomptaInscrits(Prova prova) throws RemoteException,EOlympicsException;
    public Ronda sub2carregaRonda(Ronda ronda) throws RemoteException,EOlympicsException;
    public Prova sub2carregaProva(Prova prova) throws RemoteException,EOlympicsException;
    public void sub2afegirRespostes(Ronda ronda,List<RespostaCorrecta> respostes,int usuari) throws RemoteException,EOlympicsException;
    //FI SUBSISTEMA 2


    //INICI SUBSISTEMA 3
    /**
     * Torna el numero de proves al sistema
     * @return Numero de proves del sistema
     * @throws RemoteException
     * @throws EOlympicsException
     */
    public String sub3getNumProves () throws RemoteException,EOlympicsException;

    /**
     * Funcio que torna el numero de proves en estat INSCRITES al sistema
     * @return Numero de proves en estat "INSCRITES"
     * @throws RemoteException
     * @throws EOlympicsException
     */
    public String sub3getNumProvesInscrites (String estatProva) throws RemoteException,EOlympicsException;

    /**
     * Funcio que torna el numero de proves que estan en curs (o en estat previ o en estat final)
     * @param estatPrevi
     * @param estatFinal
     * @return
     * @throws RemoteException
     * @throws EOlympicsException
     */
    public String sub3getNumProvesCurs (String estatPrevi, String estatFinal) throws RemoteException,EOlympicsException;

    /**
     * Funcio que torna el numero de proves finalitzades
     * @param estatProva
     * @return
     * @throws RemoteException
     * @throws EOlympicsException
     */
    public String sub3getNumProvesFinalitzades (String estatProva) throws RemoteException,EOlympicsException;

    /**
     * Torna el numero d'inscrits a les olimpiades
     * @return
     * @throws RemoteException
     * @throws EOlympicsException
     */
    public String sub3getNumEstudiantsInscrits() throws RemoteException,EOlympicsException;

    /**
     * Funcio que torna la mitjana d'inscrits per prova
     * @return
     * @throws RemoteException
     * @throws EOlympicsException
     */
    //public String sub3getMitjanaInscrits()  throws RemoteException,EOlympicsException;

    public String sub3getPuntuacioMitjana() throws RemoteException,EOlympicsException;
    //FI SUBSISTEMA 3


    //INICI SUBSISTEMA ESTUDIANT
    public Estudiant sub4getDadesEstudiant(String username)throws RemoteException, EOlympicsException;

    public List<DtoProva> sub4getProvesEstudiant(Integer idEstudiant)throws RemoteException, EOlympicsException;

    public Integer sub4getNombrePreguntes(Integer idProva, String tipusRonda)throws RemoteException, EOlympicsException;

    public void sub4enviarFormulariRespostes(Participacio participacio, List<RespostaEstudiant> llistat)throws RemoteException, EOlympicsException;

    public List<DtoProva> sub4getProvesDisponibles(Integer idEstudiant)throws RemoteException, EOlympicsException;

    public List<DtoProva> sub4getHistoricProvesEstudiant(Integer idEstudiant)throws RemoteException, EOlympicsException;

    public List<DtoParticipant> sub4getParticipantsProva(Integer idProva)throws RemoteException, EOlympicsException;
    
    public List<DtoProva> sub4getProvesInscritesEstudiant(Integer idEstudiant)throws RemoteException, EOlympicsException;

    public void sub4altaInscripcioProva(Integer idEstudiant, Integer idProva)throws RemoteException, EOlympicsException;

    public void sub4baixaInscripcioProva(Integer idEstudiant, Integer idProva)throws RemoteException, EOlympicsException;

    public void sub4validarNumMaxProvesEstudiant(Integer idEstudiant)throws RemoteException, ErrorInscripcioException, EOlympicsException;

    public void sub4validarNumMaxParticipantsProva(Integer idProva)throws RemoteException, ErrorInscripcioException, EOlympicsException;

    public void sub4validarEstudiantSuperatEliminatoria(Integer idEstudiant, Integer idProva)throws RemoteException, ErrorParticipacioException, EOlympicsException;

    public void sub4validarNumMaxPreguntesFormulari(Integer idProva, String tipusRonda)throws RemoteException, ErrorParticipacioException, EOlympicsException;    

    //FI SUBSISTEMA ESTUDIANT

}

